package com.blogxunadu.util;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**   
 * @ClassName:  JsonUtil   
 * @Description:
 * @author: 
 * @date:   2018年4月22日 下午1:02:54
 */
public class JsonUtil {

    public static String toJson(Object object) {
        GsonBuilder gsonBuilder = new GsonBuilder();
        gsonBuilder.setPrettyPrinting();
        Gson gson = gsonBuilder.create();
        return gson.toJson(object);
    }
}
